<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition>

	<h:outputText
		value="System error:orderInfoInputPanel: order model current is null"
		rendered="#{orderModel.current == null}"></h:outputText>
	<h:panelGrid id="orderInfoInputPanel" columns="1" rendered="#{orderModel.current != null}" style="width:100%">
		<h:panelGrid columns="2" style="float:left;width:100%">
			<h:outputText value="Customer"></h:outputText>
			<h:panelGrid columns="3" style="float:left;width:80%">
				<h:outputText
					value="#{orderModel.current.customer.lastName}  #{orderModel.current.customer.firstName}  " />
					<h:outputText
					value="#{orderModel.current.customer.telephone}   #{orderModel.current.customer.email}  " />
				<p:commandButton actionListener="#{userController.init}" ajax="true"
					update=":dialogForm,:headerForm" value="Choose"
					oncomplete="userDlg.show()"></p:commandButton>
			</h:panelGrid>
			<h:outputText value="Order Number"></h:outputText>
			<h:outputText value="#{orderModel.current.number}"></h:outputText>
			<h:outputText value="Order status"></h:outputText>
			<h:outputText value="#{orderModel.current.status.label}"></h:outputText>
			<h:outputText value="Delivery Fee" />
			<p:inputText value="#{orderModel.current.deliveryFee}"></p:inputText>
			<h:outputText value="Paid by credit" />
			<h:outputText id="paidByCredit"
				value="#{orderModel.current.paidByCreditAmount}"
				style="text-align:right">
				<f:convertNumber minFractionDigits="2" maxFractionDigits="2" />
			</h:outputText>
			<h:outputText value="Paid cash" />
			<h:outputText id="paidAmount"
				value="#{orderModel.current.paidAmount}" style="text-align:right">
				<f:convertNumber minFractionDigits="2" maxFractionDigits="2" />
			</h:outputText>
			<h:outputText value="Extra discount" />
			<h:outputText value="#{orderModel.current.discountAmount}"
				style="text-align:right">
				<f:convertNumber minFractionDigits="2" maxFractionDigits="2" />
			</h:outputText>
			<h:outputText value="Promotion credit reward" />
			<h:outputText
				value="#{orderModel.current.promotionRewardRateLabel} Reward"
				style="text-align:right">
			</h:outputText>
			<ui:remove>
				<h:outputText value="Constant order" />
				<p:selectBooleanCheckbox value="#{orderModel.current.constant}" />
				<h:outputText value="All or nothing" />
				<p:selectBooleanCheckbox value="#{orderModel.current.allOrNothing}" />
			</ui:remove>
			<h:outputText value="Comments "
				rendered="#{orderModel.current.customer == null}" />
			<h:outputText
				value="Comments(#{orderModel.current.customer.language.label}) "
				rendered="#{orderModel.current.customer != null}" />
			<h:inputTextarea value="#{orderModel.current.comments}"
				style="width:80%;height:50px" />

		</h:panelGrid>
		<p:panelGrid style="float:left;width:100%">
			<p:row>
				<p:column rowspan="8">Date</p:column>
				<p:column rowspan="1">Ordered</p:column>
				<p:column rowspan="1">
					<h:outputText value="#{orderModel.current.orderedDate}" />
				</p:column>
			</p:row>

			<p:row>
				<p:column rowspan="1">Required</p:column>
				<p:column rowspan="1">
					<p:calendar value="#{orderModel.current.requiredDate}" />
				</p:column>
			</p:row>
			<p:row>
				<p:column rowspan="1">Confirmed</p:column>
				<p:column rowspan="1">
					<h:outputText value="#{orderModel.current.confirmedDate}" />
				</p:column>
			</p:row>
			<p:row>
				<p:column rowspan="1">Prepared</p:column>
				<p:column rowspan="1">
					<h:outputText value="#{orderModel.current.preparedDate}" />
				</p:column>
			</p:row>
			<p:row>
				<p:column rowspan="1">Delivered</p:column>
				<p:column rowspan="1">
					<h:outputText value="#{orderModel.current.deliveredDate}" />
				</p:column>
			</p:row>
			<p:row>
				<p:column rowspan="1">Picked up</p:column>
				<p:column rowspan="1">
					<h:outputText value="#{orderModel.current.pickedUpDate}" />
				</p:column>
			</p:row>
			<p:row>
				<p:column rowspan="1">Paid</p:column>
				<p:column rowspan="1">
					<h:outputText value="#{orderModel.current.paidDate}" />
				</p:column>
			</p:row>
			<p:row>
				<p:column rowspan="1">Canceled</p:column>
				<p:column rowspan="1">
					<h:outputText value="#{orderModel.current.canceledDate}" />
				</p:column>
			</p:row>
		</p:panelGrid>
	</h:panelGrid>
</ui:composition>
</html>